/**
Date: 2025-08-13
Copyright (c) 2025 CAX Conversion Project
*/
// 导出公用方法(二进制流)
export function downloadFile(data, fileName, fileType) {
    let type = 'text/plain';
    if (fileType === 'bom') {
        type = 'application/vnd.ms-excel;charset=utf-8';
    }
    const url = window.URL.createObjectURL(new Blob([data], { type }));
    const link = document.createElement('a');
    link.href = url;
    link.setAttribute('download', `${fileName}.${fileType}`); // 设定下载文件名
    document.body.appendChild(link);
    link.click();
    link.remove(); // 删除临时创建的链接
}